#include "../pch.h"
#include "REFXMLName.h"

namespace BFX
{

REFXMLName* REFXMLName::Create(const UniString& strPrefix, const UniString& strLocalName, const UniString& strNs, REFXMLDocument* pOwnerDoc)
{
	REFXMLName* pNewName = new REFXMLName(strPrefix, strLocalName, strNs, pOwnerDoc);
	pNewName->Autorelease();
	return pNewName;
}

REFXMLName::REFXMLName(const UniString& strPrefix, const UniString& strLocalName, const UniString& strNs, REFXMLDocument* pOwnerDoc)
{
	m_strPrefix = strPrefix;
	m_strLocalName = strLocalName;
	m_strNs = strNs;
	m_pOwnerDoc = pOwnerDoc;
	m_strName.IsEmpty();
}

REFXMLName::~REFXMLName()
{
}

UniString REFXMLName::GetName() const
{
	if (m_strName.IsEmpty())
	{
		if (!m_strPrefix.IsEmpty())
		{
			m_strName = m_strPrefix;
		}
		if (!m_strLocalName.IsEmpty())
		{
			if (!m_strName.IsEmpty())
				m_strName += ':';
			m_strName += m_strLocalName;
		}
	}
	return m_strName;
}

}	//	namespace BFX
